package top.leyi.utils;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public   class WeekDateUtil {
     public static  final String START_TIME = "2019-09-1";
     public static  void main(String[] args)throws  Exception{
            float week = calWeek();
     }
     public static long calWeek(){
        try{
            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
            Date to = new Date();
            Date from = format.parse(START_TIME);

            return  (to.getTime() - from.getTime())/(1000*3600*24*7) + 1;
        }catch (Exception e){
            return  -1;
        }
     }
}
